INCLUDES = 						\
	$(DISABLE_DEPRECATED_CFLAGS)			\
	$(GNOME_INCLUDEDIR) 				\
	$(WARN_CFLAGS) 					\
	$(LIBPANEL_APPLET_CFLAGS)			\
	$(LUNAR_CFLAGS) 				\
	-I$(top_srcdir)/gtkchinesecalendar                  	\
	-DDATADIR=\""$(datadir)"\"			\
	-DLIBDIR=\""$(libdir)"\"			\
	-DSYSCONFDIR=\""$(sysconfdir)"\"		\
	-DPREFIX=\""$(prefix)"\"				\
	-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" 

if HAVE_LIBECAL
CALENDAR_SOURCES =		\
	calendar-client.c	\
	calendar-client.h	\
	calendar-sources.c	\
	calendar-sources.h	\
	calendar-debug.h
endif

LUNAR_SOURCES = lunar.c $(CALENDAR_SOURCES)
LUNAR_LDADD = $(LUNAR_LIBS) $(LIBPANEL_APPLET_LIBS)

if CLOCK_INPROCESS
APPLET_TYPE     = shlib
APPLET_LOCATION = $(pkglibdir)/liblunar-applet.so

lunar_appletlibdir = $(pkglibdir)
lunar_appletlib_LTLIBRARIES = liblunar-applet.la
liblunar_applet_la_SOURCES = $(LUNAR_SOURCES)
liblunar_applet_la_LIBADD = $(LUNAR_LDADD)
liblunar_applet_la_LDFLAGS = -module -avoid-version
liblunar_applet_la_CFLAGS =
else
APPLET_TYPE     = exe
APPLET_LOCATION = $(libexecdir)/lunar-applet

libexec_PROGRAMS = lunar-applet
lunar_applet_SOURCES = $(LUNAR_SOURCES)
lunar_applet_LDADD = $(LUNAR_LDADD)
lunar_applet_LDFLAGS = $(LUNAR_LDFLAGS) -I.
lunar_applet_CFLAGS = -I.
endif

uidir 	= $(datadir)/gnome-2.0/ui
ui_DATA	= GNOME_LunarApplet.xml	

serverdir       = $(libdir)/bonobo/servers
server_in_files = GNOME_LunarApplet_Factory.server.in
server_DATA     = $(server_in_files:.server.in=.server)

$(server_in_files): $(server_in_files).in Makefile
	sed -e "s|\@LOCATION\@|$(APPLET_LOCATION)|" \
	    -e "s|\@TYPE\@|$(APPLET_TYPE)|" \
	    -e "s|\@VERSION\@|$(PACKAGE_VERSION)|" \
	    $< > $@

@INTLTOOL_SERVER_RULE@

schemasdir       = $(GCONF_SCHEMA_FILE_DIR)
schemas_in_files = lunar.schemas.in
schemas_DATA     = $(schemas_in_files:.schemas.in=.schemas)

@INTLTOOL_SCHEMAS_RULE@

if GCONF_SCHEMAS_INSTALL
# don't do this if we are building in eg. rpm
install-data-local:
	if test -z "$(DESTDIR)" ; then \
		for p in $(schemas_DATA) ; do \
		        GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/src/$$p ; \
		done \
	fi
else
install-data-local:
endif

EXTRA_DIST =						\
	GNOME_LunarApplet_Factory.server.in.in		\
	$(schemas_in_files)				\
	$(ui_DATA)

CLEANFILES = $(server_in_files) $(server_DATA) $(schemas_DATA)
